<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>
<html lang="zh-ch">
<head>
<meta charset="utf-8">
<title>简洛订餐系统-菜单管理</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<jsp:include page="/WEB-INF/views/inc/inc.jsp"></jsp:include>
</head>
<body style="zoom: 1;">
	<jsp:include page="/WEB-INF/views/inc/Header.jsp"></jsp:include>
	<jsp:include page="/WEB-INF/views/inc/Inc01.jsp"></jsp:include>
	<div class="container" style="margin-top: 55px;">
		<div class="row"></div>

		<div class="row border">
		    <div class="line">
				<div class="x8"
					style="padding-left: 10px; padding-top: 5px; padding-bottom: 5px; border-bottom: solid 1px #ccc; height: 45px;">
					<button type="button" class="button bg-main button-small dialogs" id="addMenuBut" data-toggle="click" data-target="#addMenuModal" data-mask="1" data-width="20%">
				    <span class="icon-plus text-white"></span> 添加</button>
				    <button type="button" class="button bg-main button-small" id="delMenuBut" data-toggle="click" data-target="#delConfirmationModal" data-mask="1" data-width="20%">
				    <span class="icon-trash-o text-white"></span> 删除</button>
				</div>
				<div class="x4 text-right" style="border-bottom: solid 1px #ccc; height: 45px; padding-top: 5px;">
					<a class="button bg-white button-small" href="ShopManager.nut"> <span
						class="icon-mail-reply (alias)"></span> 返回
					</a>
				</div>
			</div>
			<div class="col-xs-12 " style="margin: 0px;">
            <form action="DeleteMenu.nut" method="post" id="tableForm">
				<table class="table table-striped">
					<thead>
						<tr>
							<th class="col-xs-3"></th>
							<th class="col-xs-6">菜名</th>
							<th class="col-xs-3">单价</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach var="shop" items="${obj}">
							<tr>
								<td><label class="checkbox" for="checkbox1"
									style="margin: 5px;"> <input type="checkbox"
										value="${shop.mid }" id="checkbox1" name="mids"
										data-toggle="checkbox">
								</label></td>
								<td>${shop.mname }</td>
								<td>${shop.munitprice }</td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
            </form>
			</div>
		</div>
	</div>


	<!-- Add Menu Modal -->
	<div id="addMenuModal">
		<div class="dialog fadein-top">
			<div class="dialog-head">
				<span class="close rotate-hover "></span>
                <strong>添加菜单</strong>
			</div>
			<form action="AddMenu.nut" method="post">
			<div class="dialog-body">
					<div class="login-form">
						<div class="input-group " style="margin: 10px 0px;">
							<span class="input-group-addon">菜 名：</span> <input type="text"
								class="form-control login-field" id="login-name" name="mname" />
							<input type="hidden" name="sid" value="${sid }" />
						</div>
		
						<div class="input-group" style="margin: 10px 0px;">
							<span class="input-group-addon">单 价：</span> <input
								type="text" class="form-control login-field"
								id="login-pass" name="munitprice" />
						</div>
					</div>
			</div>
			<div class="dialog-foot">
		         <button type="button" class="button dialog-close" data-dismiss="modal">关闭</button>
		         <button type="submit"  class="button bg-green" >提交</button>
		     </div>
			</form>
		</div>
	</div>

	<!-- / Add Menu Modal -->

<!-- Delete Shop Confirmation Modal -->
<div id="delConfirmationModal">
    <div class="dialog fadein-top">
        <div class="dialog-head">
            <span class="close rotate-hover "></span>
            <strong>确认删除</strong>
        </div>
        <div class="dialog-body">
        请确认是否删除已选菜单？
        </div>
        <div class="dialog-foot">
            <button type="button" class="button dialog-close" data-dismiss="modal">取消</button>
            <button type="button" class="button bg-green" id="confDelUserBut">确定</button>
        </div>
    </div>
</div>
<!-- / Delete Shop Confirmation Modal -->

	<script type="text/javascript">
		$(function() {


			 // 删除按钮
		    $("#delMenuBut").click(function(){
		    	var e = $(this);
		        var str="";
		        var sids = $("input[name='mids']:checked");
		        if(sids.length > 0){
// 		            $("#delConfirmationModal").modal();
		        	$showdialogs(e);
		        }
		    });
		    
		    // 确认删除按钮
		    $("#confDelUserBut").click(function(){
		        $('#tableForm').submit();
		    });
		});
	</script>
</body>
</html>